package com.mzj.saas.mservice.sys.controller;

import com.mzj.saas.commons.ResultBean;
import com.mzj.saas.mservice.sys.service.PublicityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 公租房公示设置
 */

@Controller
@RequestMapping("/publicity")
public class PublicityController {
    @Autowired
    private PublicityService publicityService;

    /**
     * 查看公示设置
     *
     * @param accessToken
     * @return
     */
    @GetMapping("/findPublicity")
    @ResponseBody
    public ResultBean<Object> findPublicity(@RequestHeader String accessToken) {
        return publicityService.findPublicity(accessToken);
    }

    /**
     * 设置公示设置
     *
     * @param accessToken
     * @param status      公示状态：0关闭 1开启
     * @return
     */
    @GetMapping("/setPublicity")
    @ResponseBody
    public ResultBean<Object> setPublicity(@RequestHeader String accessToken,
                                           @RequestParam(value = "status") Integer status) {
        return publicityService.setPublicity(accessToken, status);
    }


}
